﻿@model Occupie.Models.Student

<script src="~/js/jquery-ui-1.10.3.custom.js"></script>

<figure class="personal" id="personal">
    <figcaption>
        <h4 class="heading">Езици</h4>
        <div>
            @* Languages *@
            <div id="languagePartial">
                @Html.Partial("../Language/_LanguagePartial")
            </div>

            <div class="add-link">
                @Ajax.ActionLink("Добави", "AddLanguage", "Language", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "langDialog", InsertionMode = InsertionMode.Replace, OnSuccess = "openLangPopup" })<br />
            </div>

            <div class="dialog" id="langDialog" style="display: none;"></div>
        </div>
    </figcaption>
</figure>

<figure class="personal" id="personal">
    <figcaption>
        <h4 class="heading">Технологии</h4>
        <div>
            @* Technologies *@
            <div id="techPartial">
                @Html.Partial("../Technology/_TechnologyPartial")
            </div>

            <div class="add-link">
                @Ajax.ActionLink("Добави", "AddTechnology", "Technology", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "techDialog", InsertionMode = InsertionMode.Replace, OnSuccess = "openTechPopup" })<br />
            </div>
            @* Technologies *@
        </div>
        <div class="dialog" id="techDialog" style="display: none;"></div>
    </figcaption>
</figure>

<script type="text/javascript">
    $(document).ready(function () {
        $("#langDialog").dialog(
            {
                autoOpen: false,
                width: 300,
                height: 'auto',
                modal: true
            }
        );
    });
    function openLangPopup() {
        $("#langDialog").dialog("open");
    }

    $(document).ready(function () {
        $("#techDialog").dialog(
            {
                autoOpen: false,
                width: 300,
                height: 'auto',
                modal: true
            }
        );
    });
    function openTechPopup() {
        $("#techDialog").dialog("open");
    }

    function deleteTech(id) {
        $("#tech" + id).remove();
    }

</script>

<script>
        for (var i = 0; i < ('@Model.Languages.Count') ; i++) {
        $("#Languages_" + i + "__Proficiency").kendoDropDownList();
    }

    for (var i = 0; i < ('@Model.Technologies.Count') ; i++) {
        $("#Technologies_" + i + "__Proficiency").kendoDropDownList();
    }
</script>
